package com.bw.day03.adapter

import android.graphics.Paint
import android.media.tv.TvView
import android.widget.TextView
import com.bw.base.net.entity.Goods
import com.bw.day03.R

import com.bw.day03.util.GlideUtlis
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

class GoodsAdapter:BaseQuickAdapter<Goods,BaseViewHolder>(R.layout.item_goods) {
    override fun convert(holder: BaseViewHolder, item: Goods) {
        GlideUtlis.loadCorner(context,item.image,holder.getView(R.id.goods_image),20)
        holder.setText(R.id.goods_storeMessage,item.storeName)
        holder.setText(R.id.goods_price,"￥"+item.price)
        holder.setText(R.id.goods_otPrice,"￥"+item.otPrice)
        holder.setText(R.id.goods_sale,"已售${item.sales+item.ficti}"+"件")
        var view = holder.getView<TextView>(R.id.goods_otPrice)
        view.paintFlags=Paint.STRIKE_THRU_TEXT_FLAG
    }

}